
#! /usr/bin/env python
#coding=utf-8

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time


username=input("username:")
passwd=input("passwd:")


driver =  webdriver.Chrome()
time.sleep(3)

driver.get("http://jp.ops.net")  #打开浏览器
driver.find_element_by_name("username").click()
driver.find_element_by_name("username").clear()
driver.find_element_by_name("username").send_keys(username)
driver.find_element_by_name("password").clear()
driver.find_element_by_name("password").send_keys(passwd)
driver.find_element_by_name("password").send_keys(Keys.ENTER)
driver.find_element_by_link_text("资产管理").click()
driver.find_element_by_link_text("资产列表").click()

"""
driver.find_element("name","username").click()
driver.find_element("name","username").send_keys("xxx")
driver.find_element("name","password").send_keys("xxx")
driver.find_element("name","password").send_keys(Keys.ENTER)
"""

time.sleep(60)
driver.close()